<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Canbot: CanBotLL.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Canbot
   
   </div>
   <div id="projectbrief">TEAM B</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="headertitle">
<div class="title">CanBotLL.h</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * CanBotLL.h</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> *  Created on: 6-mrt.-2014</span>
<a name="l00005"></a>00005 <span class="comment"> *      Author: thomas</span>
<a name="l00006"></a>00006 <span class="comment"> */</span>
<a name="l00007"></a>00007 
<a name="l00008"></a>00008 <span class="preprocessor">#ifndef CANBOTLL_H_</span>
<a name="l00009"></a>00009 <span class="preprocessor"></span><span class="preprocessor">#define CANBOTLL_H_</span>
<a name="l00010"></a>00010 <span class="preprocessor"></span>
<a name="l00011"></a>00011 <span class="preprocessor">#include &quot;Serial.h&quot;</span>
<a name="l00012"></a>00012 <span class="preprocessor">#include &lt;stdlib.h&gt;</span>
<a name="l00013"></a>00013 <span class="preprocessor">#include &lt;unistd.h&gt;</span>
<a name="l00014"></a>00014 <span class="preprocessor">#include &lt;cmath&gt;</span>
<a name="l00015"></a>00015 
<a name="l00016"></a>00016 <span class="preprocessor">#define LOW_SPEED 50</span>
<a name="l00017"></a>00017 <span class="preprocessor"></span><span class="preprocessor">#define MAX_SPEED 200</span>
<a name="l00018"></a>00018 <span class="preprocessor"></span>
<a name="l00019"></a>00019 <span class="keyword">const</span> <span class="keywordtype">int</span> CLAW_OPEN = 1;
<a name="l00020"></a>00020 <span class="keyword">const</span> <span class="keywordtype">int</span> CLAW_CLOSE = 0;
<a name="l00021"></a>00021 <span class="comment">//Drempelwaarden voor snelheid:</span>
<a name="l00022"></a>00022 <span class="preprocessor">#define ANGLE_HIGH_SPEED 10</span>
<a name="l00023"></a>00023 <span class="preprocessor"></span><span class="preprocessor">#define DIST_HIGH_SPEED 20 //cm</span>
<a name="l00024"></a>00024 <span class="preprocessor"></span>
<a name="l00025"></a>00025 <span class="comment">//Duurtijd voor motoren:</span>
<a name="l00026"></a>00026 <span class="comment">//#define US_10DG_HS 1000</span>
<a name="l00027"></a>00027 <span class="preprocessor">#define US_1DG_HS 9625</span>
<a name="l00028"></a>00028 <span class="preprocessor"></span><span class="comment">//NOG BEREKENEN</span>
<a name="l00029"></a>00029 <span class="comment">//#define US_1DG_LS 1000</span>
<a name="l00030"></a>00030 <span class="preprocessor">#define US_1UNIT_HS 10000</span>
<a name="l00031"></a>00031 <span class="preprocessor"></span>
<a name="l00036"></a><a class="code" href="classCanBotLL.html">00036</a> <span class="keyword">class </span><a class="code" href="classCanBotLL.html" title="CanBotLL is the Low Level implementation on CanBot. This class is responsible for the serial communic...">CanBotLL</a> {
<a name="l00037"></a>00037 <span class="keyword">private</span>:
<a name="l00038"></a>00038         <a class="code" href="classSerial.html" title="Serial is the implementation for setting up and maintaining the serial communication. class responsible for the serial communication with the robot.">Serial</a> *ser_robot;
<a name="l00039"></a>00039         <span class="keywordtype">void</span> driveMotor(<span class="keywordtype">int</span> speedL, <span class="keywordtype">int</span> speedR);
<a name="l00040"></a>00040         <span class="keywordtype">string</span> serial_read;
<a name="l00041"></a>00041 
<a name="l00042"></a>00042 <span class="keyword">public</span>:
<a name="l00048"></a>00048         <a class="code" href="classCanBotLL.html#a3060fba49d13632f2a2d54cac98e0ddf">CanBotLL</a>();
<a name="l00053"></a>00053         <span class="keyword">virtual</span> <a class="code" href="classCanBotLL.html#a087386b4c135c16f773663fed6eb59d2">~CanBotLL</a>();
<a name="l00054"></a>00054 
<a name="l00059"></a>00059         <span class="keywordtype">int</span> <a class="code" href="classCanBotLL.html#a24f80105dff33991e6aa24f0aace2a0b">claw</a>(<span class="keywordtype">int</span> open_close);
<a name="l00060"></a>00060 
<a name="l00068"></a>00068         <span class="keywordtype">int</span> <a class="code" href="classCanBotLL.html#a93694ef7809a249f10ebedfca98bbcc1">turn</a>(<span class="keywordtype">int</span> angle);
<a name="l00069"></a>00069 
<a name="l00077"></a>00077         <span class="keywordtype">int</span> <a class="code" href="classCanBotLL.html#a5b6e2cb5ef7e052dc937abc605c090ed">drive</a>(<span class="keywordtype">int</span> <a class="code" href="classCanBotLL.html#ab42fa57d0f4339ff15e2d83f9188b987">distance</a>);
<a name="l00078"></a>00078 
<a name="l00085"></a>00085         <span class="keywordtype">int</span> <a class="code" href="classCanBotLL.html#a06c977b32a0207f009bcf71b292f4ed4">catchCan</a>();
<a name="l00086"></a>00086 
<a name="l00091"></a>00091         <span class="keywordtype">int</span> <a class="code" href="classCanBotLL.html#ab42fa57d0f4339ff15e2d83f9188b987">distance</a>();
<a name="l00092"></a>00092 
<a name="l00093"></a>00093         <span class="comment">//tweede instantie</span>
<a name="l00102"></a>00102 <span class="comment"></span>        <span class="keywordtype">int</span> <a class="code" href="classCanBotLL.html#a60c06aee49f028b504e181c81ccf0175">turnStart</a>(<span class="keywordtype">int</span> dir); <span class="comment">//0 rechts 1 links</span>
<a name="l00103"></a>00103 
<a name="l00112"></a>00112         <span class="keywordtype">int</span> <a class="code" href="classCanBotLL.html#a98be95fe221b50461a960f28117e83f9">driveStart</a>(<span class="keywordtype">int</span> dir);<span class="comment">//0 achter 1 voor</span>
<a name="l00113"></a>00113 
<a name="l00120"></a>00120         <span class="keywordtype">int</span> <a class="code" href="classCanBotLL.html#a2850c2db5c516b349ce8f873ebcb9b2f">movementStop</a>();
<a name="l00121"></a>00121 };
<a name="l00122"></a>00122 
<a name="l00123"></a>00123 <span class="preprocessor">#endif </span><span class="comment">/* CANBOTLL_H_ */</span>
</pre></div></div><!-- contents -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Fri Apr 25 2014 16:43:26 for Canbot by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>

</body>
</html>
